<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>

<head>
	<meta charset="UTF-8">
	<title>欢迎页面-L-admin1.0</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<link rel="stylesheet" href="../../layui/css/layui.css" media="all">
	<link rel="stylesheet" href="../../layui/css/formSelects-v4.css" media="all">
	<link rel="shortcut icon" href="../../statics/favicon.ico" type="image/x-icon"/>
	<link rel="stylesheet" href="../../statics/css/font.css">
	<link rel="stylesheet" href="../../statics/css/xadmin.css">
	<script src="../../statics/js/jquery.min.js"></script>
	<script type="text/javascript" src="../../layui/layui.js" charset="utf-8"></script>
	<script type="text/javascript" src="../../statics/js/xadmin.js"></script>
</head>
<body class="childrenBody">
<form class="layui-row changePwd" style="padding: 20px 20px 10px 20px;background-color: #fff;">
	<div class="layui-col-xs12 layui-col-sm6 layui-col-md6" align="center">

		<div class="layui-form-item" style="display: none" align="center">
			<label class="layui-form-label">id</label>
			<div class="layui-input-block">
				<input id="id" type="text" disabled class="layui-input layui-disabled">
			</div>
		</div>
		
		<!--
		选择框选择数量     selectBorrowNumId
		-->

		<div class="layui-form-item" align="center">
			<div class="">
				<input style="float:left;"  id="selectBorrowNumId" value="1" type="number" oninput="this.value = this.value.replace(/[^1-9]/g, '');" class="layui-input">

				<button style="float: right;" class="layui-btn layui-btn-warm" lay-submit="" lay-filter="sure" >确定</button>
			</div>
		</div>


	</div>
</form>
</body>
<script>
	layui.use(['form'], function () {
		$ = layui.jquery;
		var form = layui.form,
				layer = layui.layer;
		form.on('submit(sure)', function (data) {
			debugger;
			$.ajax({
				method:"post",
				url:"/goods/goodsHandleState",
				data:{goodsId:$("#id").val(),selectBorrowNum:$("#selectBorrowNumId").val()},
				success:function (result) {
					if(0===result.code){
						layer.msg(result.msg, {icon: 1, time: 1000},function () {
						});
					}else{
						layer.msg(result.msg, {icon: 5, time: 1000});
					}

				}
			})
			return false;
		});
	});




</script>
